/**
 * Project Name:wwe
 * File Name:BaseServiceImpl.java
 * Package Name:pers.billson.wwe.common
 * Date:2017年4月4日下午8:12:34
 * Copyright ©2017, billson0618@163.com All Rights Reserved.
 *
*/

package pers.billson.wwe.common;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Discription: 基础Service接口实现类 <br/>
 *
 * @author Billson
 * @date 2017年4月4日 下午8:12:34
 */
@Service
public class BaseServiceImpl<T> implements BaseService<T> {

	@Autowired
	private BaseDao<T> baseDao;

	@Override
	public T getById(long id) {
		return this.baseDao.queryById(id);
	}

	@Override
	public T getById(String id) {
		return this.baseDao.queryById(id);
	}

	@Override
	public List<T> listAll() {
		return this.baseDao.queryAll();
	}

	@Override
	public int deleteById(long id) {
		return this.baseDao.deleteById(id);
	}

	@Override
	public int deleteById(String id) {
		return this.baseDao.deleteById(id);
	}

	@Override
	public int update(T t) {
		return this.baseDao.update(t);
	}

	@Override
	public int save(T t) {
		return this.baseDao.insert(t);
	}

}
